<?php
session_start();
if($_POST){
	
	$u = $_POST['username'];
	$p = $_POST['password'];
	
	if($u == 'admin' && $p == 'admin'){
	
$_SESSION['magnet'] = 'admin';
header('Location:homePage.php');
	}
	else
		$error = 'Username and Password not correct!';
	
}

if(isset($_GET['action'])){
	
	if($_GET['action'] == 'logout'){
		
		unset($_SESSION['magnet']);
		session_destroy();
		
	}
	
}
?>